Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(directive): throw if output the same event more than once #5113

Closed

Conversation

erictsangx
Copy link
Contributor

Close: #4798

if (isPresent(dm.outputs)) {
dm.outputs.forEach((propName: string) => {
if (ListWrapper.contains(outputs, propName)) {
throw new BaseException(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include the type name as well in the error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced selector with type name

throw new BaseException(
`Output the same event more than once: '${propName}' in '${stringify(this.type)}'`);
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be that dm.OUTPUTS contains the same event twice ? Should we check that too ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it. I decided not to check since outputs: ['eventA','eventA'] should looks weird.

@erictsangx erictsangx force-pushed the check-dulplicate-outputs branch 2 times, most recently from 07f0b46 to 4813c94 Compare November 7, 2015 11:08
dm.outputs.forEach((propName: string) => {
if (ListWrapper.contains(outputs, propName)) {
throw new BaseException(
`Output the same event more than once: '${propName}' in '${stringify(type)}'`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change the message to "Output event '${propName}' defined multiple times in '${stringify(type)}'

@IgorMinar
Copy link
Contributor

the rest looks good

@IgorMinar IgorMinar added pr_state: LGTM action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Dec 2, 2015
@IgorMinar IgorMinar self-assigned this Dec 2, 2015
@erictsangx
Copy link
Contributor Author

@IgorMinar updated

@IgorMinar IgorMinar added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Dec 15, 2015
@IgorMinar
Copy link
Contributor

Merge instructions: if problems are identified during merge & sync lets punt this to beta.1

// @alexeagle

@mary-poppins
Copy link

Merging PR #5113 on behalf of @alexeagle to branch presubmit-alexeagle-pr-5113.

@mary-poppins
Copy link

Merging PR #5113 on behalf of @IgorMinar to branch presubmit-IgorMinar-pr-5113.

@IgorMinar IgorMinar modified the milestones: beta.0, beta.1 Dec 15, 2015
@mary-poppins
Copy link

Merging PR #5113 on behalf of @rkirov to branch presubmit-rkirov-pr-5113.

@rkirov
Copy link
Contributor

rkirov commented Jan 12, 2016

merged at 8c37b7e

@rkirov rkirov closed this Jan 12, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should only fire output property once even if both in [outputs] and decorated w/ @Output
8 participants